<template>
	<view>
		<view class="head">
			<view class="list up"  v-for="(item,index) in 5" :class="current==index?'active':''" :key="index" @click="toggle(index)">
				全部
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current:'0',
			};
		},
		methods:{
			toggle(index){
				this.$emit('toggle',index)
				this.current=index
			}
		}
	}
</script>

<style lang="scss" scoped>
		.head{
			display: flex;
			justify-content: space-between;
			background-color: #fff;
			box-shadow: 0 0 5rpx #999;
			.list{
				width: 100%;
				height: 100rpx;
				line-height: 100rpx;
				text-align: center;
				margin: auto;
				box-sizing: border-box;
			}
			.active{
				border-bottom: 5rpx solid #000BFF ;
			}
			
		}
		
</style>
